<?php
Util::tsRegisterAssetJs('admin.js');
/** @var PersonaController $this */
/** @var Persona $model */
$this->menu = array(
    array('label' => Yii::t('AweCrud.app', 'Create'), 'icon' => 'plus', 'url' => array('create'),
    //'visible' => (Util::checkAccess(array('action_incidenciaPrioridad_create')))
    ),
);
?>
<div id="flashMsg"  class="flash-messages">

</div> 
<div class="widget blue" >
    <div class="widget-title">
        <h4> <i class="icon-fire-extinguisher"></i> <?php echo Yii::t('AweCrud.app', 'Manage') ?> <?php echo Persona::label(2) ?> </h4>
        <span class="tools">
            <a href="javascript:;" class="icon-chevron-down"></a>
            <!--a href="javascript:;" class="icon-remove"></a-->
        </span>
    </div>
    <div class="widget-body">
        <?php
        $this->widget('ext.Truulo.TruuloModuleSearch', array(
            'model' => $model,
            'grid_id' => 'persona-grid',
        ));
        ?>
        <?php
//        $this->widget('bootstrap.widgets.TbGridView', array(
//            'id' => 'persona-grid',
//            'type' => 'striped bordered hover advance',
//            'dataProvider' => $model->search(),
        $this->widget('ext.selgridview.BootSelGridView', array(
            'id' => 'persona-grid',
            'type' => 'striped bordered hover advance',
            'template' => '{items}{summary}{pager}',
            'dataProvider' => $model->search(),
            'selectableRows' => 1,
            'columns' => array(
                array(
                    'class' => 'CCheckBoxColumn',
                ),
//        'columns' => array(
//                'id_persona',
//                'id_grado',
                array(
                    'name' => 'id_grado',
//                        'value' => '$data->Emp_Gru_Codigo?$data->Grupo->Emp_Gru_Codigo:null',
                    'value' => 'isset($data->perGraCodigo) ? $data->perGraCodigo : null',
                ),
//                'apellidos',
                array(
                    'name' => 'apellidos',
                    'value' => 'CHtml::link($data->apellidos, Yii::app()->createUrl("clientes/persona/view",array("id"=>$data->id_persona)))',
                    'type' => 'raw',
//                    "callback" => "js:Mensaje()"
                ),
                'nombres',
                'peloton',
                'cedula',
                'codigo_isffa',
                /*
                  'foto',
                  'fecha_nacimiento',
                  'id_provincia',
                  'ciudad',
                  'numero_cuenta',
                  'fusil',
                  'id_tipo_sangre',
                  'id_licencia',
                  'id_vuelo',
                  'id_genero',
                 */
                array(
                    'class' => 'CButtonColumn',
                    'template' => '{view} {update} {delete}',
//                    'afterDelete' => 'function(link,success,data){ 
//                    if(success) {
//                         $("#flashMsg").empty();
//                         $("#flashMsg").css("display","");
//                         $("#flashMsg").html(data).animate({opacity: 1.0}, 5500).fadeOut("slow");
//                    }
//                    }',
                    'buttons' => array(
                        'view' => array(
                            'label' => '<button class="btn btn-primary btn-success"><i class="icon-search"></i></button>',
                            'options' => array('title' => 'Ver'),
                            'imageUrl' => false,
//                            'click' => 'js:Mensaje(true)',
                        //'visible' => 'Util::checkAccess(array("action_incidenciaPrioridad_update"))'
                        ),
                        'update' => array(
                            'label' => '<button class="btn btn-primary"><i class="icon-pencil"></i></button>',
                            'options' => array('title' => 'Actualizar'),
                            'imageUrl' => false,
                        //'visible' => 'Util::checkAccess(array("action_incidenciaPrioridad_update"))'
                        ),
                        'delete' => array(
                            'label' => '<button class="btn btn-danger"><i class="icon-trash"></i></button>',
                            'options' => array('title' => 'Eliminar'),
                            'imageUrl' => false,
//                        'visible' => 'Util::checkAccess(array("action_cliente_delete"))'
                        ),
                    ),
                    'htmlOptions' => array(
                        'width' => '130px',
                    )
                ),
            ),
        ));
        ?>
    </div>
</div>
<!--<form id="formId" method="post" target="blank">
    <input  id="id_persona" name="Persona">
</form>-->